<include file="Index/Common/header" title="ThinkPHP框架" keywords="开源WEB开发框架"/>
<include file="Index/Common/size-nav"/>
<div id="main">

  <div class="content_wrapper">
      <div class="container-fluid">
          <div class="row">
              <div class="col-sm-12">
                  <aside>
                      <header><i class="fa fa-fw fa-file"></i>新增文章</header>
                      <section>
                          <div class="container-fluid">
                              <div class="row">
                                  <div class="col-sm-12">
                                      <form class="form-horizontal" role="form" id="add-form">
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章标题</label>
                                              <div class="col-sm-3">
                                                  <input type="text" class="form-control" value="{$vo.title}"placeholder="文章标题" name="title">
                                                  <input type="hidden" name="news_id" value="{$vo.news_id}">
                                              </div>
                                              <p class="col-sm-7 help-block">必填</p>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章分类</label>
                                              <div class="col-sm-3">
                                                  <select class="form-control" name="cid">
                                                      <option value="">请选择</option>
                                                      <volist name="cid" id="cid">
                                                        <option value="{$cid.menu_id}"<if condition="$cid.menu_id eq $vo['cid']">selected</if>>{$cid.title}</option>
                                                      </volist>
                                                  </select>
                                              </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章失效时间</label>
                                              <div class="col-sm-3">
                                                  <select class="form-control" name="fail_time">
                                                      <option value="0"<if condition="$vo.fail_time eq 0">selected</if>>请选择</option>
                                                      <option value="1"<if condition="$vo.fail_time eq 1">selected</if>>1天</option>
                                                      <option value="2"<if condition="$vo.fail_time eq 2">selected</if>>2天</option>
                                                      <option value="3"<if condition="$vo.fail_time eq 3">selected</if>>3天</option>
                                                      <option value="4"<if condition="$vo.fail_time eq 4">selected</if>>4天</option>
                                                      <option value="5"<if condition="$vo.fail_time eq 5">selected</if>>5天</option>
                                                      <option value="6"<if condition="$vo.fail_time eq 6">selected</if>>6天</option>
                                                      <option value="7"<if condition="$vo.fail_time eq 7">selected</if>>7天</option>
                                                  </select>
                                              </div>
                                              <p class="col-sm-7 help-block">不选择表示没有失效时间</p>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                            <label for="inputname" class="col-sm-2 control-label">缩图:</label>
                                             <div class="col-sm-10">
                                               <input id="img_upload"  type="file" multiple >
                                                 <img id="img_upload_success" src="{$vo.img_url}" alt="" style="max-height:150px;max-width:200px">
                                             </div>
                                           </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">简介</label>
                                              <div class="col-sm-10">
                                                  <textarea class="form-control" name="desc">{$vo.desc}</textarea>
                                              </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">标签</label>
                                              <div class="col-sm-10" id="tab-box">
                                                  <input type="text" class="form-control" name="tab" id="news-tab">
                                                  <volist name="vo['tab']" id="tab">
                                                    <a class='layui-btn layui-btn-normal news-tab' style=display:inline-block;margin-top:10px;text-decoration:none attr-keyword ="{$tab}">{$tab}</a>
                                                  </volist>
                                              </div>

                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                            <div class="col-sm-12">
                                              <textarea id="content" style="height:400px;max-height:500px">

                                              </textarea>
                                            </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <div class="col-sm-12">
                                                  <button type="button" class="btn btn-primary" id="btn-news-submit">提交</button>
                                              </div>
                                          </div>
                                      </form>
                                  </div>
                              </div>
                          </div>
                      </section>
                  </aside>
              </div>
          </div>
      </div>

  </div>

</div>
<include file="Index/Common/footer"/>
<script src="__PUBLIC__/Admin/js/wangEditor/dist/js/wangEditor.js" charset="utf-8"></script>
<script src="__PUBLIC__/Admin/js/uploadify/jquery.uploadify.min.js" charset="utf-8"></script>
<script src="__PUBLIC__/Admin/js/upload.js" charset="utf-8"></script>
<script type="text/javascript">
var URL = {
  'swf':"__PUBLIC__/Admin/js/uploadify/uploadify.swf",
  'cancelImg_url':"__PUBLIC__/Admin/js/uploadify/uploadify-cancel.png",
  'add_url':"{:U('Admin/News/add')}",
  'jump_url':"{:U('Admin/News/index')}",
  'imgUpload_url':"{:U('Admin/Uploads/image')}",
}
  wangEditor.config.printLog = false;//关掉日志提示
  var editor = new wangEditor('content');
  editor.create();
  editor.$txt.html('{$vo.content}');
</script>
</body>
</html>
